home *** CD-ROM | disk | FTP | other *** search
Text File | 2001-04-17 | 68.9 KB | 1,255 lines |
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- NNNNAAAAMMMMEEEE
- _bbbb_ssss_hhhh_,,,, _jjjj_ssss_hhhh - shell, the standard/job control command programming language
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- _bbbb_ssss_hhhh [ ----aaaacccceeeeffffhhhhiiiikkkknnnnpppprrrrssssttttuuuuvvvvxxxx ] [ args ]
- _jjjj_ssss_hhhh [ ----aaaacccceeeeffffhhhhiiiikkkknnnnpppprrrrssssttttuuuuvvvvxxxx ] [ args ]
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- NNNNooootttteeee:::: This is the Bourne shell description. All references to _s_h and
- _s_h_e_l_l pertain to _b_s_h and all references below to /_u_s_r/_l_i_b/_r_s_h, the
- restricted shell, no longer apply to the Bourne shell. (See _ssss_hhhh_((((_1111_))))).
-
- _b_s_h is a command programming language that executes commands read from a
- terminal or a file.
-
- _j_s_h is an interface to the shell that provides all the functionality of
- _s_h and enables Job Control (see JJJJoooobbbb CCCCoooonnnnttttrrrroooollll below).
-
- See IIIInnnnvvvvooooccccaaaattttiiiioooonnnn below for the meaning of arguments to the shell.
-
- See CCCCAAAAVVVVEEEEAAAATTTTSSSS below for interaction with Korn shell builtins.
-
- DDDDeeeeffffiiiinnnniiiittttiiiioooonnnnssss
- A _b_l_a_n_k is a tab or a space. A _n_a_m_e is a sequence of letters, digits, or
- underscores beginning with a letter or underscore. A _p_a_r_a_m_e_t_e_r is a
- name, a digit, or any of the characters ****, @@@@, ####, ????, ----, $$$$, and !!!! ....
-
- CCCCoooommmmmmmmaaaannnnddddssss
- A _s_i_m_p_l_e-_c_o_m_m_a_n_d is a sequence of non-blank _w_o_r_d_s separated by _b_l_a_n_k_s.
- The first word specifies the name of the command to be executed. Except
- as specified below, the remaining words are passed as arguments to the
- invoked command. The command name is passed as argument 0 (see _e_x_e_c(2)).
- The _v_a_l_u_e of a _s_i_m_p_l_e-_c_o_m_m_a_n_d is its exit status if it terminates
- normally, or (octal) 200+_s_t_a_t_u_s if it terminates abnormally (see
- _s_i_g_n_a_l(2) for a list of status values).
-
- A _p_i_p_e_l_i_n_e is a sequence of one or more _c_o_m_m_a_n_d_s separated by ||||. The
- standard output of each command but the last is connected by a _p_i_p_e(2) to
- the standard input of the next command. Each command is run as a
- separate process; the shell waits for the last command to terminate. The
- exit status of a pipeline is the exit status of the last command.
-
- A _l_i_s_t is a sequence of one or more pipelines separated by ;;;;, &&&&, &&&&&&&&, or
- ||||||||, and optionally terminated by ;;;; or &&&&. Of these four symbols, ;;;; and &&&&
- have equal precedence, which is lower than that of &&&&&&&& and ||||||||. The
- symbols &&&&&&&& and |||||||| also have equal precedence. A semicolon (;;;;) causes
- sequential execution of the preceding pipeline; an ampersand (&&&&) causes
- asynchronous execution of the preceding pipeline (that is, the shell does
- _n_o_t wait for that pipeline to finish). The symbol &&&&&&&& (||||||||) causes the
- _l_i_s_t following it to be executed only if the preceding pipeline returns a
- zero (nonzero) exit status. An arbitrary number of newlines can appear
- in a _l_i_s_t, instead of semicolons, to delimit commands.
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- A _c_o_m_m_a_n_d is either a _s_i_m_p_l_e-_c_o_m_m_a_n_d or one of the following. Unless
- otherwise stated, the value returned by a command is that of the last
- _s_i_m_p_l_e-_c_o_m_m_a_n_d executed in the command.
-
- ffffoooorrrr _n_a_m_e [ iiiinnnn _w_o_r_d ... ] ddddoooo _l_i_s_t ddddoooonnnneeee
- Each time a ffffoooorrrr command is executed, _n_a_m_e is set to the next
- _w_o_r_d taken from the iiiinnnn _w_o_r_d list. If iiiinnnn _w_o_r_d ... is omitted,
- the ffffoooorrrr command executes the ddddoooo _l_i_s_t once for each positional
- parameter that is set (see PPPPaaaarrrraaaammmmeeeetttteeeerrrr SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn below).
- Execution ends when there are no more words in the list.
-
- ccccaaaasssseeee _w_o_r_d iiiinnnn [ _p_a_t_t_e_r_n [ | _p_a_t_t_e_r_n ] ...)))) _l_i_s_t ;;;;;;;; ] ... eeeessssaaaacccc
- A ccccaaaasssseeee command executes the _l_i_s_t associated with the first
- _p_a_t_t_e_r_n that matches _w_o_r_d. The form of the patterns is the
- same as that used for filename generation (see FFFFiiiilllleeeennnnaaaammmmeeee
- GGGGeeeennnneeeerrrraaaattttiiiioooonnnn) except that a slash, a leading dot, or a dot
- immediately following a slash need not be matched explicitly.
-
- iiiiffff _l_i_s_t tttthhhheeeennnn _l_i_s_t [ eeeelllliiiiffff _l_i_s_t tttthhhheeeennnn _l_i_s_t ] ... [ eeeellllsssseeee _l_i_s_t ] ffffiiii
- The _l_i_s_t following iiiiffff is executed and, if it returns a zero
- exit status, the _l_i_s_t following the first tttthhhheeeennnn is executed.
- Otherwise, the _l_i_s_t following eeeelllliiiiffff is executed and, if its
- value is zero, the _l_i_s_t following the next tttthhhheeeennnn is executed.
- Failing that, the eeeellllsssseeee _l_i_s_t is executed. If no eeeellllsssseeee _l_i_s_t or
- tttthhhheeeennnn _l_i_s_t is executed, the iiiiffff command returns a zero exit
- status.
-
- wwwwhhhhiiiilllleeee _l_i_s_t ddddoooo _l_i_s_t ddddoooonnnneeee
- A wwwwhhhhiiiilllleeee command repeatedly executes the wwwwhhhhiiiilllleeee _l_i_s_t and, if the
- exit status of the last command in the list is zero, executes
- the ddddoooo _l_i_s_t; otherwise the loop terminates. If no commands in
- the ddddoooo _l_i_s_t are executed, the wwwwhhhhiiiilllleeee command returns a zero exit
- status; uuuunnnnttttiiiillll can be used in place of wwwwhhhhiiiilllleeee to negate the loop
- termination test.
-
- ((((_l_i_s_t)))) Execute _l_i_s_t in a subshell.
-
- {{{{_l_i_s_t;;;;}}}} _l_i_s_t is executed in the current (that is, parent) shell. The {{{{
- must be followed by a space.
-
- _n_a_m_e (((()))) {{{{_l_i_s_t;;;;}}}}
- Define a function that is referenced by _n_a_m_e. The body of the
- function is the _l_i_s_t of commands between {{{{ and }}}}. The _l_i_s_t can
- appear on the same line as the _{{{{. If it does, the {{{{ and _l_i_s_t
- must be separated by a space. The }}}} cannot be on the same line
- as _l_i_s_t; it must be on a newline. Execution of functions is
- described below (see EEEExxxxeeeeccccuuuuttttiiiioooonnnn). The _{{{{ and _}}}} are unnecessary
- if the body of the function is a _c_o_m_m_a_n_d as defined above,
- under CCCCoooommmmmmmmaaaannnnddddssss.
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- The following words are only recognized as the first word of a command
- and when not quoted:
-
- iiiiffff tttthhhheeeennnn eeeellllsssseeee eeeelllliiiiffff ffffiiii ccccaaaasssseeee eeeessssaaaacccc ffffoooorrrr wwwwhhhhiiiilllleeee uuuunnnnttttiiiillll ddddoooo ddddoooonnnneeee {{{{ }}}}
-
-
- CCCCoooommmmmmmmeeeennnnttttssss
- A word beginning with #### causes that word and all the following characters
- up to a newline to be ignored.
-
- CCCCoooommmmmmmmaaaannnndddd SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
- The shell reads commands from the string between two grave accents (````````)
- and the standard output from these commands can be used as all or part of
- a word. Trailing newlines from the standard output are removed.
-
- No interpretation is done on the string before the string is read, except
- to remove backslashes (\\\\) used to escape other characters. Backslashes
- can be used to escape a grave accent (````) or another backslash (\\\\) and are
- removed before the command string is read. Escaping grave accents allows
- nested command substitution. If the command substitution lies within a
- pair of double quotes ("""" ............ ````............```` ............ """"), a backslash used to escape a
- double quote (\\\\"""") is removed; otherwise, it is left intact.
-
- If a backslash is used to escape a newline character (\\\\nnnneeeewwwwlllliiiinnnneeee), both the
- backslash and the newline are removed (see the later section on
- "Quoting"). In addition, backslashes used to escape dollar signs (\\\\$$$$)
- are removed. Since no interpretation is done on the command string
- before it is read, inserting a backslash to escape a dollar sign has no
- effect. Backslashes that precede characters other than \\\\, ````, """", nnnneeeewwwwlllliiiinnnneeee,
- and $$$$ are left intact when the command string is read.
-
- PPPPaaaarrrraaaammmmeeeetttteeeerrrr SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
- The character $$$$ is used to introduce substitutable _p_a_r_a_m_e_t_e_r_s. There are
- two types of parameters, positional and keyword. If _p_a_r_a_m_e_t_e_r is a
- digit, it is a positional parameter. Positional parameters can be
- assigned values by sssseeeetttt. Keyword parameters (also known as variables) can
- be assigned values by writing:
-
- _n_a_m_e ==== _v_a_l_u_e [ _n_a_m_e ==== _v_a_l_u_e ] ...
-
- Pattern-matching is not performed on _v_a_l_u_e. There cannot be a function
- and a variable with the same _n_a_m_e.
-
- $$$${{{{_p_a_r_a_m_e_t_e_r}}}} The value, if any, of the parameter is substituted.
- The braces are required only when _p_a_r_a_m_e_t_e_r is
- followed by a letter, digit, or underscore that is
- not to be interpreted as part of its name. If
- _p_a_r_a_m_e_t_e_r is **** or @@@@, all the positional parameters,
- starting with $$$$1111, are substituted (separated by
- spaces). Parameter $$$$0000 is set from argument zero when
- the shell is invoked.
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- $$$${{{{_p_a_r_a_m_e_t_e_r::::----_w_o_r_d}}}} If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute its
- value; otherwise substitute _w_o_r_d.
-
- $$$${{{{_p_a_r_a_m_e_t_e_r::::====_w_o_r_d}}}} If _p_a_r_a_m_e_t_e_r is not set or is null set it to _w_o_r_d;
- the value of the parameter is substituted.
- Positional parameters cannot be assigned to in this
- way.
-
- $$$${{{{_p_a_r_a_m_e_t_e_r::::????_w_o_r_d}}}} If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute its
- value; otherwise, print _w_o_r_d and exit from the shell.
- If _w_o_r_d is omitted, the message "parameter null or
- not set" is printed.
-
- $$$${{{{_p_a_r_a_m_e_t_e_r::::++++_w_o_r_d}}}} If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute _w_o_r_d;
- otherwise substitute nothing.
-
- In the above, _w_o_r_d is not evaluated unless it is to be used as the
- substituted string, so that, in the following example, ppppwwwwdddd is executed
- only if dddd is not set or is null:
-
- _eeee_cccc_hhhh_oooo _$$$$_{{{{_dddd_::::_----_````_pppp_wwww_dddd_````_}}}}
-
- If the colon (::::) is omitted from the above expressions, the shell only
- checks whether _p_a_r_a_m_e_t_e_r is set or not.
-
- The following parameters are automatically set by the shell:
-
- **** Expands to the positional parameters, beginning with _1111.
-
- @@@@ Expands to the positional parameters beginning with _1111, except when
- expanded within double quotes, in which case each positional
- parameter expands as a separate field.
-
- #### The number of positional parameters in decimal.
-
- ---- Flags supplied to the shell on invocation or by the sssseeeetttt command.
-
- ???? The decimal value returned by the last synchronously executed
- command.
-
- $$$$ The process number of this shell. _$$$$ reports the process ID of the
- parent shell in all shell constructs, including pipelines, and in
- parenthesized subshells.
-
- !!!! The process number of the last background command invoked.
-
- The following parameters are used by the shell:
-
- HHHHOOOOMMMMEEEE The default argument (home directory) for the _cccc_dddd command, set
- to the user's login directory by _llll_oooo_gggg_iiii_nnnn(1) from the password
- file (see _pppp_aaaa_ssss_ssss_wwww_dddd(4)).
-
-
-
-
- PPPPaaaaggggeeee 4444
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- PPPPAAAATTTTHHHH The search path for commands (see EEEExxxxeeeeccccuuuuttttiiiioooonnnn below). The user
- cannot change PPPPAAAATTTTHHHH if executing under _r_s_h.
-
- CCCCDDDDPPPPAAAATTTTHHHH The search path for the _c_d command.
-
- MMMMAAAAIIIILLLL If this parameter is set to the name of a mail file _a_n_d the
- MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH parameter is not set, the shell informs the user of
- the arrival of mail in the specified file.
-
- MMMMAAAAIIIILLLLCCCCHHHHEEEECCCCKKKK This parameter specifies how often (in seconds) the shell
- checks for the arrival of mail in the files specified by the
- MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH or MMMMAAAAIIIILLLL parameters. The default value is 600 seconds
- (10 minutes). If set to 0, the shell checks before each
- prompt.
-
- MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH A colon (::::) separated list of filenames. If this parameter is
- set, the shell informs the user of the arrival of mail in any
- of the specified files. Each filename can be followed by %%%% and
- a message to be printed when the modification time changes.
- The default message is "you have mail".
-
- PPPPSSSS1111 Primary prompt string, by default ``$$$$ ''.
-
- PPPPSSSS2222 Secondary prompt string, by default ``>>>> ''.
-
- IIIIFFFFSSSS Internal field separators, normally ssssppppaaaacccceeee, ttttaaaabbbb, and nnnneeeewwwwlllliiiinnnneeee.
-
- SSSSHHHHAAAACCCCCCCCTTTT If this parameter is set to the name of a file writable by the
- user, the shell writes an accounting record in the file for
- each shell procedure executed.
-
- SSSSHHHHEEEELLLLLLLL When the shell is invoked, it scans the environment (see
- EEEEnnnnvvvviiiirrrroooonnnnmmmmeeeennnntttt below) for this name. If it is found and 'rsh' is
- the filename part of its value, the shell becomes a restricted
- shell.
-
- The shell gives default values to PPPPAAAATTTTHHHH, PPPPSSSS1111, PPPPSSSS2222, MMMMAAAAIIIILLLLCCCCHHHHEEEECCCCKKKK, and IIIIFFFFSSSS.
- HHHHOOOOMMMMEEEE and MMMMAAAAIIIILLLL are set by _l_o_g_i_n(1).
-
- BBBBllllaaaannnnkkkk IIIInnnntttteeeerrrrpppprrrreeeettttaaaattttiiiioooonnnn
- After parameter and command substitution, the results of substitution are
- scanned for internal field separator characters (those found in IIIIFFFFSSSS) and
- split into distinct arguments where such characters are found. Explicit
- null arguments ("""""""" or '''''''') are retained. Implicit null arguments (those
- resulting from _p_a_r_a_m_e_t_e_r_s that have no values) are removed. The original
- whitespace characters (space, tab, and newline) are always considered
- internal field separators.
-
- IIIInnnnppppuuuutttt////OOOOuuuuttttppppuuuutttt
- A command's input and output can be redirected using a special notation
- interpreted by the shell. The following can appear anywhere in a
- _s_i_m_p_l_e-_c_o_m_m_a_n_d or can precede or follow a _c_o_m_m_a_n_d and are _n_o_t passed on
-
-
-
- PPPPaaaaggggeeee 5555
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- as arguments to the invoked command. Note that parameter and command
- substitution occurs before _w_o_r_d or _d_i_g_i_t is used.
-
- <<<<wwwwoooorrrrdddd Use file _w_o_r_d as standard input (file descriptor 0).
-
- >>>>wwwwoooorrrrdddd Use file _w_o_r_d as standard output (file descriptor 1). If the
- file does not exist it is created; otherwise, it is truncated
- to zero length.
-
- >>>>>>>>wwwwoooorrrrdddd Use file _w_o_r_d as standard output. If the file exists output is
- appended to it (by first seeking to the end-of-file);
- otherwise, the file is created.
-
- <<<<<<<<[----]wwwwoooorrrrdddd After parameter and command substitution is done on _w_o_r_d, the
- shell input is read up to the first line that literally matches
- the resulting _w_o_r_d, or to an end-of-file. If, however, ---- is
- appended to <<<<<<<<:
-
- 1. Leading tabs are stripped from _w_o_r_d before the shell input
- is read (but after parameter and command substitution is
- done on _w_o_r_d).
-
- 2. Leading tabs are stripped from the shell input as it is
- read and before each line is compared with _w_o_r_d.
-
- 3. Shell input is read up to the first line that literally
- matches the resulting _w_o_r_d, or to an end-of-file.
-
- If any character of _w_o_r_d is quoted (see QQQQuuuuoooottttiiiinnnngggg, later), no
- additional processing is done to the shell input. If no
- characters of _w_o_r_d are quoted:
-
- 1. Parameter and command substitution occurs.
-
- 2. (Escaped) \\\\nnnneeeewwwwlllliiiinnnneeee is ignored.
-
- 3. \\\\ must be used to quote the characters \\\\, $$$$, and ````.
-
- The resulting document becomes the standard input.
-
- <<<<&&&&_d_i_g_i_t Use the file associated with file descriptor _d_i_g_i_t as standard
- input. Similarly for the standard output using >>>>&&&&_d_i_g_i_t.
-
- <<<<&&&&---- The standard input is closed. Similarly for the standard
- output using >>>>&&&&----.
-
- If any of the above is preceded by a digit, the file descriptor that will
- be associated with the file is that specified by the digit (instead of
- the default 0 or 1). For example:
-
-
-
-
-
-
- PPPPaaaaggggeeee 6666
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- _...._...._.... _2222_>>>>_&&&&_1111
-
- associates file descriptor 2 with the file currently associated with file
- descriptor 1.
-
- The order in which redirections are specified is significant. The shell
- evaluates redirections left-to-right. For example:
-
- _...._...._.... _1111_>>>>_x_x_x _2222_>>>>_&&&&_1111
-
- first associates file descriptor 1 with file _x_x_x. It associates file
- descriptor 2 with the file associated with file descriptor 1 (that is,
- _x_x_x). If the order of redirections were reversed, file descriptor 2
- would be associated with the terminal (assuming file descriptor 1 had
- been) and file descriptor 1 would be associated with file _x_x_x.
-
- Using the terminology introduced on the first page, under CCCCoooommmmmmmmaaaannnnddddssss, if a
- _c_o_m_m_a_n_d is composed of several _s_i_m_p_l_e _c_o_m_m_a_n_d_s, redirection is evaluated
- for the entire _c_o_m_m_a_n_d before it is evaluated for each _s_i_m_p_l_e _c_o_m_m_a_n_d.
- That is, the shell evaluates redirection for the entire _l_i_s_t, then each
- _p_i_p_e_l_i_n_e within the _l_i_s_t, then each _c_o_m_m_a_n_d within each _p_i_p_e_l_i_n_e, then
- each _l_i_s_t within each _c_o_m_m_a_n_d.
-
- If a command is followed by &&&& the default standard input for the command
- is the empty file /_d_e_v/_n_u_l_l. Otherwise, the environment for the
- execution of a command contains the file descriptors of the invoking
- shell as modified by input/output specifications.
-
- Redirection of output is not allowed in the restricted shell.
-
- FFFFiiiilllleeeennnnaaaammmmeeee GGGGeeeennnneeeerrrraaaattttiiiioooonnnn
- Before a command is executed, each command _w_o_r_d is scanned for the
- characters ****, ????, and [[[[. If one of these characters appears the word is
- regarded as a _p_a_t_t_e_r_n. The word is replaced with alphabetically sorted
- filenames that match the pattern. If no filename is found that matches
- the pattern, the word is left unchanged. The character .... at the start of
- a filename or immediately following a ////, as well as the character ////
- itself, must be matched explicitly.
-
- **** Matches any string, including the null string.
-
- ???? Matches any single character.
-
- [[[[...]]]]
- Matches any one of the enclosed characters. A pair of characters
- separated by ---- matches any character lexically between the pair,
- inclusive. If the first character following the opening [[[[ is a !!!!,
- any character not enclosed is matched.
-
- QQQQuuuuoooottttiiiinnnngggg
- The following characters have a special meaning to the shell and cause
- termination of a word unless quoted:
-
-
-
- PPPPaaaaggggeeee 7777
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- ;;;; &&&& (((( )))) |||| ^^^^ <<<< >>>> nnnneeeewwwwlllliiiinnnneeee ssssppppaaaacccceeee ttttaaaabbbb
-
- A character can be _q_u_o_t_e_d that is, made to stand for itself) by preceding
- it with a backslash (\\\\) or inserting it between a pair of quote marks (''''''''
- or """"""""). During processing, the shell can quote certain characters to
- prevent them from taking on a special meaning. Backslashes used to quote
- a single character are removed from the word before the command is
- executed. The pair \\\\nnnneeeewwwwlllliiiinnnneeee is removed from a word before command and
- parameter substitution.
-
- All characters enclosed between a pair of single quote marks (''''''''), except
- a single quote, are quoted by the shell. Backslash has no special
- meaning inside a pair of single quotes. A single quote can be quoted
- inside a pair of double quote marks (for example, """"''''"""").
-
- Inside a pair of double quote marks (""""""""), parameter and command
- substitution occurs and the shell quotes the results to avoid blank
- interpretation and filename generation. If $$$$**** is within a pair of double
- quotes, the positional parameters are substituted and quoted, separated
- by quoted spaces (""""$$$$1111 $$$$2222 ...""""); however, if $$$$@@@@ is within a pair of double
- quotes, the positional parameters are substituted and quoted, separated
- by unquoted spaces (""""$$$$1111"""" """"$$$$2222"""" ...). \\\\ quotes the characters \\\\, ````, """", and
- $$$$. The pair \\\\nnnneeeewwwwlllliiiinnnneeee is removed before parameter and command
- substitution. If a backslash precedes characters other than \\\\, ````, """", $$$$,
- and newline, then the backslash itself is quoted by the shell.
-
- PPPPrrrroooommmmppppttttiiiinnnngggg
- When used interactively, the shell prompts with the value of PPPPSSSS1111 before
- reading a command. If at any time a newline is typed and further input
- is needed to complete a command, the secondary prompt that is, the value
- of PPPPSSSS2222) is issued.
-
- EEEEnnnnvvvviiiirrrroooonnnnmmmmeeeennnntttt
- The _e_n_v_i_r_o_n_m_e_n_t (see _e_n_v_i_r_o_n(5)) is a list of name-value pairs that is
- passed to an executed program in the same way as a normal argument list.
- The shell interacts with the environment in several ways. On invocation,
- the shell scans the environment and creates a parameter for each name
- found, giving it the corresponding value. If the user modifies the value
- of any of these parameters or creates new parameters, none of these
- affects the environment unless the eeeexxxxppppoooorrrrtttt command is used to bind the
- shell's parameter to the environment (see also sssseeeetttt ----aaaa). A parameter can
- be removed from the environment with the uuuunnnnsssseeeetttt command. The environment
- seen by any executed command is thus composed of any unmodified name-
- value pairs originally inherited by the shell, minus any pairs removed by
- uuuunnnnsssseeeetttt, plus any modifications or additions, all of which must be noted in
- eeeexxxxppppoooorrrrtttt commands.
-
- The environment for any _s_i_m_p_l_e-_c_o_m_m_a_n_d can be augmented by prefixing it
- with one or more assignments to parameters. Thus these two commands are
- equivalent (as far as the execution of _c_m_d is concerned if _c_m_d is not a
- Special Command):
-
-
-
-
- PPPPaaaaggggeeee 8888
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- _TTTT_EEEE_RRRR_MMMM_====_4444_5555_0000 _cccc_mmmm_dddd
- _((((_eeee_xxxx_pppp_oooo_rrrr_tttt _TTTT_EEEE_RRRR_MMMM_;;;; _TTTT_EEEE_RRRR_MMMM_====_4444_5555_0000_;;;; _cccc_mmmm_dddd_))))
-
- If _c_m_d is a Special Command, then
-
- _TTTT_EEEE_RRRR_MMMM_====_4444_5555 _cccc_mmmm_dddd
-
- modifies the _TTTT_EEEE_RRRR_MMMM variable in the current shell.
-
- If the ----kkkk flag is set, _a_l_l keyword arguments are placed in the
- environment, even if they occur after the command name. The following
- first prints aaaa====bbbb cccc and cccc:
-
- _eeee_cccc_hhhh_oooo _aaaa_====_bbbb _cccc
- _ssss_eeee_tttt _----_kkkk
- _eeee_cccc_hhhh_oooo _aaaa_====_bbbb _cccc
-
-
- SSSSiiiiggggnnnnaaaallllssss
- When a command is run in the background (_c_m_d _&&&&) under _ssss_hhhh, it can receive
- INTERRUPT and QUIT signals but ignores them by default. (A background
- process can override this default behavior via trap or signal. For
- details, see the description of _tttt_rrrr_aaaa_pppp, below, or _ssss_iiii_gggg_nnnn_aaaa_llll(2).) When a
- command is run in the background under _jjjj_ssss_hhhh, however, it does not receive
- INTERRUPT or QUIT signals.
-
- Otherwise signals have the values inherited by the shell from its parent,
- with the exception of signal 11 (SIGSEGV). See also the _tttt_rrrr_aaaa_pppp command
- below.
-
- EEEExxxxeeeeccccuuuuttttiiiioooonnnn
- Each time a command is executed, the command substitution, parameter
- substitution, blank interpretation, input/output redirection, and
- filename generation listed above are carried out. If the command name
- matches the name of a defined function, the function is executed in the
- shell process (note how this differs from the execution of shell
- procedures). If the command name does not match the name of a defined
- function, but matches one of the SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss listed below, it is
- executed in the shell process. The positional parameters $$$$1111, $$$$2222, and so
- on are set to the arguments of the function. If the command name matches
- neither a Special Command nor the name of a defined function, a new
- process is created and an attempt is made to execute the command via
- _e_x_e_c(2).
-
- The shell parameter PPPPAAAATTTTHHHH defines the search path for the directory
- containing the command. Alternative directory names are separated by a
- colon (::::). The default path is:
-
- ::::////uuuussssrrrr////ssssbbbbiiiinnnn::::////uuuussssrrrr////bbbbssssdddd::::////bbbbiiiinnnn::::////uuuussssrrrr////bbbbiiiinnnn::::////uuuussssrrrr////bbbbiiiinnnn////XXXX11111111
-
- specifying the current directory, /_u_s_r/_s_b_i_n, /_u_s_r/_b_s_d, /_b_i_n, /_u_s_r/_b_i_n,
- and /_u_s_r/_b_i_n/_X_1_1, in that order. Note that the current directory is
-
-
-
- PPPPaaaaggggeeee 9999
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- specified by a null pathname. It can appear immediately after the equal
- sign, between two colon delimiters anywhere in the path list, or at the
- end of the path list. If the command name contains a //// the search path
- is not used; such commands are not executed by the restricted shell.
- Otherwise, each directory in the path is searched for an executable file.
- If the file has execute permission but is not an aaaa....oooouuuutttt file, it is
- assumed to be a file containing shell commands. A subshell is spawned to
- read it. A parenthesized command is also executed in a subshell.
-
- The location in the search path where a command was found is remembered
- by the shell (to help avoid unnecessary _e_x_e_c_s later). If the command was
- found in a relative directory, its location must be re-determined
- whenever the current directory changes. The shell forgets all remembered
- locations whenever the PPPPAAAATTTTHHHH variable is changed or the hhhhaaaasssshhhh ----rrrr command is
- executed (see below).
-
- SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss
- Input/output redirection is now permitted for these commands. File
- descriptor 1 is the default output location. When Job Control is
- enabled, additional Special Commands are added to the shell's environment
- (see JJJJoooobbbb CCCCoooonnnnttttrrrroooollll).
-
- :::: No effect; the command does nothing. A zero exit
- code is returned.
-
- .... _f_i_l_e Read and execute commands from _f_i_l_e and return. The
- search path specified by PPPPAAAATTTTHHHH is used to find the
- directory containing _f_i_l_e.
-
- bbbbrrrreeeeaaaakkkk [ _n ] Exit from the enclosing ffffoooorrrr or wwwwhhhhiiiilllleeee loop, if any.
- If _n is specified break _n levels.
-
- ccccoooonnnnttttiiiinnnnuuuueeee [ _n ] Resume the next iteration of the enclosing ffffoooorrrr or
- wwwwhhhhiiiilllleeee loop. If _n is specified resume at the _n-th
- enclosing loop.
-
- ccccdddd [ _a_r_g ] Change the current directory to _a_r_g. The shell
- parameter HHHHOOOOMMMMEEEE is the default _a_r_g. The shell
- parameter CCCCDDDDPPPPAAAATTTTHHHH defines the search path for the
- directory containing _a_r_g. Alternative directory
- names are separated by a colon (::::). The default path
- is <<<<nnnnuuuullllllll>>>> (specifying the current directory). Note
- that the current directory is specified by a null
- pathname. It can appear immediately after the equal
- sign or between the colon delimiters anywhere else in
- the path list. If _a_r_g begins with a //// the search
- path is not used. Otherwise, each directory in the
- path is searched for _a_r_g. The _c_d command cannot be
- executed by _r_s_h.
-
-
-
-
-
-
- PPPPaaaaggggeeee 11110000
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- eeeecccchhhhoooo [ _a_r_g ... ] Echo arguments. See _e_c_h_o(1) for usage and
- description.
-
- eeeevvvvaaaallll [ _a_r_g ... ] The arguments are read as input to the shell and the
- resulting command(s) executed.
-
- eeeexxxxeeeecccc [ _a_r_g ... ] The command specified by the arguments is executed in
- place of this shell without creating a new process.
- Input/output arguments can appear and, if no other
- arguments are given, cause the shell input/output to
- be modified.
-
- eeeexxxxiiiitttt [ _n ] Causes a shell to exit with the exit status specified
- by _n. If _n is omitted, the exit status is that of
- the last command executed (an end-of-file also causes
- the shell to exit.)
-
- eeeexxxxppppoooorrrrtttt [ _n_a_m_e ... ] The given _n_a_m_es are marked for automatic export to
- the _e_n_v_i_r_o_n_m_e_n_t of subsequently-executed commands.
- If no arguments are given, variable names that have
- been marked for export during the current shell's
- execution are listed. (Variable names exported from
- a parent shell are listed only if they have been
- exported again during the current shell's execution.)
- Function names are _n_o_t exported.
-
- ggggeeeettttooooppppttttssss Use in shell scripts to support command syntax
- standards (see _i_n_t_r_o(1)); it parses positional
- parameters and checks for legal options. See
- _g_e_t_o_p_t_s(1) for usage and description.
-
- hhhhaaaasssshhhh [ ----rrrr ] [ _n_a_m_e ... ]
- For each _n_a_m_e, the location in the search path of the
- command specified by _n_a_m_e is determined and
- remembered by the shell. The ----rrrr option causes the
- shell to forget all remembered locations. If no
- arguments are given, information about remembered
- commands is presented. _h_i_t_s is the number of times a
- command has been invoked by the shell process. _c_o_s_t
- is a measure of the work required to locate a command
- in the search path. If a command is found in a
- "relative" directory in the search path, after
- changing to that directory, the stored location of
- that command is recalculated. Commands for which
- this is done are indicated by an asterisk (****)
- adjacent to the _h_i_t_s information. _c_o_s_t is
- incremented when the recalculation is done.
-
- lllliiiimmmmiiiitttt [ ----hhhh ] [ _r_e_s_o_u_r_c_e [_m_a_x_i_m_u_m-_u_s_e ] ]
- Limits the consumption by the current process and
- each process it creates to not individually exceed
- _m_a_x_i_m_u_m-_u_s_e on the specified _r_e_s_o_u_r_c_e. If no
-
-
-
- PPPPaaaaggggeeee 11111111
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- _m_a_x_i_m_u_m-_u_s_e is given, then the current limit is
- printed; if no _r_e_s_o_u_r_c_e is given, then all
- limitations are given. If the ----hhhh flag is given, the
- hard limits are used instead of the current limits.
- The hard limits impose a ceiling on the values of the
- current limits. Only the superuser can raise the
- hard limits, but a user can lower or raise the
- current limits within the legal range.
-
- Resources controllable currently include _c_p_u_t_i_m_e, the
- maximum number of cpu-seconds to be used by each
- process, _f_i_l_e_s_i_z_e, the largest single file that can
- be created, _d_a_t_a_s_i_z_e, the maximum growth of the data
- region via _s_b_r_k(2) beyond the end of the program
- text, _s_t_a_c_k_s_i_z_e, the maximum size of the
- automatically-extended stack region, _c_o_r_e_d_u_m_p_s_i_z_e,
- the size of the largest core dump created, _m_e_m_o_r_y_u_s_e,
- the maximum amount of physical memory a process can
- have allocated to it at a given time, _d_e_s_c_r_i_p_t_o_r_s,
- the maximum number of open files, and _v_m_e_m_o_r_y, the
- maximum total virtual size of the process, including
- text, data, heap, shared memory, mapped files, stack,
- and so on.
-
- The _m_a_x_i_m_u_m-_u_s_e can be given as a (floating point or
- integer) number followed by a scale factor. For all
- limits other than _c_p_u_t_i_m_e the default scale is kkkk or
- kkkkiiiilllloooobbbbyyyytttteeeessss (1024 bytes); a scale factor of mmmm or
- mmmmeeeeggggaaaabbbbyyyytttteeeessss can also be used. For _c_p_u_t_i_m_e the default
- scaling is sssseeeeccccoooonnnnddddssss, while mmmm for minutes or hhhh for
- hours, or a time of the form _m_m::::_s_s giving minutes and
- seconds can be used.
-
- For both _r_e_s_o_u_r_c_e names and scale factors,
- unambiguous prefixes of the names suffice.
-
- nnnneeeewwwwggggrrrrpppp [ _a_r_g ... ] Equivalent to eeeexxxxeeeecccc nnnneeeewwwwggggrrrrpppp _a_r_g .... See _n_e_w_g_r_p(1) for
- usage and description.
-
- ppppwwwwdddd Print the current working directory. See _p_w_d(1) for
- usage and description.
-
- rrrreeeeaaaadddd [ _n_a_m_e ... ] One line is read from the standard input and, using
- the internal field separator, IIIIFFFFSSSS (normally space or
- tab), to delimit word boundaries, the first word is
- assigned to the first _n_a_m_e, the second word to the
- second _n_a_m_e, and so on, with leftover words assigned
- to the last _n_a_m_e. Lines can be continued using
- \\\\nnnneeeewwwwlllliiiinnnneeee. Characters other than nnnneeeewwwwlllliiiinnnneeee can be
- quoted by preceding them with a backslash. These
- backslashes are removed before words are assigned to
- _n_a_m_e_s, and no interpretation is done on the character
-
-
-
- PPPPaaaaggggeeee 11112222
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- that follows the backslash. The return code is 0
- unless an end-of-file is encountered.
-
- rrrreeeeaaaaddddoooonnnnllllyyyy [ _n_a_m_e ... ]
- The given _n_a_m_es are marked rrrreeeeaaaaddddoooonnnnllllyyyy and the values of
- the these _n_a_m_es cannot be changed by subsequent
- assignment. If no arguments are given, a list of all
- rrrreeeeaaaaddddoooonnnnllllyyyy names is printed.
-
- rrrreeeettttuuuurrrrnnnn [ _n ] Causes a function to exit with the return value
- specified by _n. If _n is omitted, the return status
- is that of the last command executed.
-
- sssseeeetttt [ --------aaaaeeeeffffhhhhkkkknnnnttttuuuuvvvvxxxx [ _a_r_g ... ] ]
-
- ----aaaa Mark variables that are modified or created for
- export.
-
- ----eeee Exit immediately if a command exits with a
- nonzero exit status.
-
- ----ffff Disable filename generation.
-
- ----hhhh Locate and remember function commands as
- functions are defined (function commands are
- normally located when the function is executed).
-
- ----kkkk All keyword arguments are placed in the
- environment for a command, not just those that
- precede the command name.
-
- ----nnnn Read commands but do not execute them.
-
- ----tttt Exit after reading and executing one command.
-
- ----uuuu Treat unset variables as an error when
- substituting.
-
- ----vvvv Print shell input lines as they are read.
-
- ----xxxx Print commands and their arguments as they are
- executed.
-
- -------- Do not change any of the flags; useful in
- setting $$$$1111 to ----.
-
- Using ++++ rather than ---- causes these flags to be turned
- off. These flags can also be used upon invocation of
- the shell. The current set of flags can be found in
- $$$$----. The remaining arguments are positional
- parameters and are assigned, in order, to $$$$1111, $$$$2222,
- .... If no arguments are given the values of all
-
-
-
- PPPPaaaaggggeeee 11113333
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- names are printed.
-
- sssshhhhiiiifffftttt [ _n ] The positional parameters from $$$$nnnn++++1111 ... are renamed
- $$$$1111 .... If _n is not given, it is assumed to be 1.
-
- tttteeeesssstttt Evaluate conditional expressions. See _t_e_s_t(1) for
- usage and description.
-
- ttttiiiimmmmeeeessss Print the accumulated user and system times for
- processes run from the shell.
-
- ttttrrrraaaapppp [ _a_r_g ] [ _n ] ...
- The command _a_r_g is to be read and executed when the
- shell receives signal(s) _n. (Note that _a_r_g is
- scanned once when the trap is set and once when the
- trap is taken.) Trap commands are executed in order
- of signal number. Any attempt to set a trap on a
- signal that was ignored on entry to the current shell
- is ineffective. An error results when an attempt is
- made to trap signal 11 (SIGSEGV--segmentation fault).
- If _a_r_g is absent all trap(s) _n are reset to their
- original values. If _a_r_g is the null string this
- signal is ignored by the shell and by the commands it
- invokes. If _n is 0 the command _a_r_g is executed on
- exit from the shell. The ttttrrrraaaapppp command with no
- arguments prints a list of commands associated with
- each signal number.
-
- ttttyyyyppppeeee [ _n_a_m_e ... ] For each _n_a_m_e, indicate how it would be interpreted
- if used as a command name.
-
- uuuulllliiiimmmmiiiitttt [ _n ] Impose a size limit of _n blocks on files written by
- the shell and its child processes (files of any size
- can be read). If _n is omitted, the current limit is
- printed. You can lower your own ulimit, but only a
- superuser (see _s_u(1M)) can raise a ulimit.
-
- uuuummmmaaaasssskkkk [ _n_n_n ] The user file creation mask is set to _n_n_n (see
- _u_m_a_s_k(1)). If _n_n_n is omitted, the current value of
- the mask is printed.
-
- uuuunnnnlllliiiimmmmiiiitttt [ ----hhhh ] [ _r_e_s_o_u_r_c_e ]
- Removes the limitation on _r_e_s_o_u_r_c_e. If no _r_e_s_o_u_r_c_e
- is specified, then all _r_e_s_o_u_r_c_e limitations are
- removed. If ----hhhh is given, the corresponding hard
- limits are removed. Only the superuser can do this.
-
- uuuunnnnsssseeeetttt [ _n_a_m_e ... ] For each _n_a_m_e, remove the corresponding variable or
- function. The variables PPPPAAAATTTTHHHH, PPPPSSSS1111, PPPPSSSS2222, MMMMAAAAIIIILLLLCCCCHHHHEEEECCCCKKKK
- and IIIIFFFFSSSS cannot be unset.
-
-
-
-
-
- PPPPaaaaggggeeee 11114444
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- wwwwaaaaiiiitttt [ _n ] Wait for your background process whose process id is
- _n and report its termination status. If _n is
- omitted, all your shell's currently active background
- processes are waited for and the return code is zero.
-
- IIIInnnnvvvvooooccccaaaattttiiiioooonnnn
- If the shell is invoked through _e_x_e_c(2) and the first character of
- argument zero is ----, commands are initially read from /_e_t_c/_p_r_o_f_i_l_e and
- from $_H_O_M_E/._p_r_o_f_i_l_e, if such files exist. Thereafter, commands are read
- as described below, which is also the case when the shell is invoked as
- /_b_i_n/_s_h. The flags below are interpreted by the shell on invocation
- only; Note that unless the ----cccc or ----ssss flag is specified, the first argument
- is assumed to be the name of a file containing commands, and the
- remaining arguments are passed as positional parameters to that command
- file:
-
- ----cccc _s_t_r_i_n_g
- If the ----cccc flag is present, commands are read from _s_t_r_i_n_g.
-
- ----ssss If the ----ssss flag is present or if no arguments remain, commands are
- read from the standard input. Any remaining arguments specify the
- positional parameters. Shell output (except for Special Commands)
- is written to file descriptor 2.
-
- ----iiii If the ----iiii flag is present or if the shell input and output are
- attached to a terminal, this shell is _i_n_t_e_r_a_c_t_i_v_e. In this case
- TERMINATE is ignored (so that kkkkiiiillllllll 0000 does not kill an interactive
- shell) and INTERRUPT is caught and ignored (so that wwwwaaaaiiiitttt is
- interruptible). In all cases, QUIT is ignored by the shell.
-
- ----pppp If the ----pppp flag is present, the shell skips the processing of the
- system profile (_////_eeee_tttt_cccc_////_pppp_rrrr_oooo_ffff_iiii_llll_eeee) and the user profile (_...._pppp_rrrr_oooo_ffff_iiii_llll_eeee) when
- it starts.
-
- ----rrrr If the ----rrrr flag is present the shell is a restricted shell.
-
- The remaining flags and arguments are described under the _ssss_eeee_tttt command
- above.
-
- JJJJoooobbbb CCCCoooonnnnttttrrrroooollll ((((jjjjsssshhhh))))
- When the shell is invoked as _jjjj_ssss_hhhh, Job Control is enabled in addition to
- all of the functionality described previously for _ssss_hhhh. Typically Job
- Control is enabled for the interactive shell only. Noninteractive shells
- typically do not benefit from the added functionality of Job Control.
-
- With Job Control enabled every command or pipeline the user enters at the
- terminal is called a _j_o_b. All jobs exist in one of the following states:
- foreground, background, or stopped. These terms are defined as follows:
- 1) a job in the foreground has read and write access to the controlling
- terminal; 2) a job in the background is denied read access and has
- conditional write access to the controlling terminal (see _ssss_tttt_tttt_yyyy(1)); 3) a
- stopped job is a job that has been placed in a suspended state, usually
-
-
-
- PPPPaaaaggggeeee 11115555
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- as a result of a _SSSS_IIII_GGGG_TTTT_SSSS_TTTT_PPPP signal (see _ssss_iiii_gggg_nnnn_aaaa_llll(2)). Jobs in the foreground
- can be stopped by INTERRUPT or QUIT signals from the keyboard; background
- jobs cannot be stopped by these signals.
-
- Every job the shell starts is assigned a positive integer, called a _j_o_b
- _n_u_m_b_e_r, which is tracked by the shell and is used, later, as an
- identifier to indicate a specific job. Additionally the shell keeps
- track of the _c_u_r_r_e_n_t and _p_r_e_v_i_o_u_s jobs. The _c_u_r_r_e_n_t _j_o_b is the most
- recent job to be started or restarted. The _p_r_e_v_i_o_u_s _j_o_b is the first
- noncurrent job.
-
- The acceptable syntax for a Job Identifier is of the form:
-
- _%%%%_j_o_b_i_d
-
- where _j_o_b_i_d can be specified in any of the following formats:
-
- _%%%% or _++++ For the current job.
-
- _---- For the previous job.
-
- _????_s_t_r_i_n_g Specify the job for which the command line uniquely contains
- _s_t_r_i_n_g.
-
- _n For job number _n, where _n is a job number.
-
- _p_r_e_f Where _p_r_e_f is a unique prefix of the command name (for example,
- if the command _llll_ssss _----_llll _ffff_oooo_oooo were running in the background, it
- could be referred to as _%%%%_llll_ssss); _p_r_e_f cannot contain blanks unless
- it is quoted.
-
- When Job Control is enabled, the following commands are added to the
- user's environment to manipulate jobs:
-
- _bbbb_gggg [_%%%%_j_o_b_i_d ...] Resumes the execution of a stopped job in the
- background. If _%%%%_j_o_b_i_d is omitted the current job is
- assumed.
-
- _ffff_gggg [_%%%%_j_o_b_i_d ...] Resumes the execution of a stopped job in the
- foreground, also moves an executing background job
- into the foreground. If _%%%%_j_o_b_i_d is omitted the
- current job is assumed.
-
- _jjjj_oooo_bbbb_ssss [_----_pppp_||||_----_llll] [_%%%%_j_o_b_i_d ...]
-
- _jjjj_oooo_bbbb_ssss _----_xxxx _c_o_m_m_a_n_d [_a_r_g_u_m_e_n_t_s]
- Reports all jobs that are stopped or executing in the
- background. If _%%%%_j_o_b_i_d is omitted, all jobs that are
- stopped or running in the background are reported.
- The following options modify/enhance the output of
- _jjjj_oooo_bbbb_ssss:
-
-
-
-
- PPPPaaaaggggeeee 11116666
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- _----_llll Report the process group ID and working
- directory of the jobs.
-
- _----_pppp Report only the process group ID of the jobs.
-
- _----_xxxx Replace any _j_o_b_i_d found in _c_o_m_m_a_n_d or _a_r_g_u_m_e_n_t_s
- with the corresponding process group ID, and
- then execute _c_o_m_m_a_n_d passing it _a_r_g_u_m_e_n_t_s.
-
- _kkkk_iiii_llll_llll [-_ssss_iiii_gggg_nnnn_aaaa_llll] _%%%%_j_o_b_i_d
- Builtin version of _kkkk_iiii_llll_llll to provide the functionality
- of the _kkkk_iiii_llll_llll command for processes identified with a
- _j_o_b_i_d.
-
- _ssss_tttt_oooo_pppp _%%%%_j_o_b_i_d . . . Stops the execution of a background job(s).
-
- _ssss_uuuu_ssss_pppp_eeee_nnnn_dddd Stops the execution of the current shell (but not if
- it is the login shell).
-
- _wwww_aaaa_iiii_tttt [_%%%%_j_o_b_i_d ...] _wwww_aaaa_iiii_tttt builtin accepts a job identifier. If _%%%%_j_o_b_i_d is
- omitted, _wwww_aaaa_iiii_tttt behaves as described above under
- SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss.
-
- RRRReeeessssttttrrrriiiicccctttteeeedddd SSSShhhheeeellllllll ((((////uuuussssrrrr////lllliiiibbbb////rrrrsssshhhh)))) OOOOnnnnllllyyyy
- _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_rrrr_ssss_hhhh is used to set up login names and execution environments
- whose capabilities are more controlled than those of the standard shell.
- The actions of _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_rrrr_ssss_hhhh are identical to those of _ssss_hhhh, except that the
- following are disallowed:
-
- +o changing directory (see _c_d(1))
- +o setting the value of $$$$PPPPAAAATTTTHHHH
- +o specifying path or command names containing ////
- +o redirecting output (>>>> and >>>>>>>>)
-
- The restrictions above are enforced after ._p_r_o_f_i_l_e is interpreted.
-
- A restricted shell can be invoked in one of the following ways: (1) _r_s_h
- is the filename part of the last entry in the /_e_t_c/_p_a_s_s_w_d file (see
- _p_a_s_s_w_d(4)); (2) the environment variable SSSSHHHHEEEELLLLLLLL exists and _r_s_h is the
- filename part of its value; (3) the shell is invoked and _r_s_h is the
- filename part of argument 0; (4) the shell is invoke with the ----rrrr option.
-
- When a command to be executed is found to be a shell procedure,
- /_u_s_r/_l_i_b/_r_s_h invokes _s_h to execute it. Thus, it is possible to provide
- to the end-user shell procedures that have access to the full power of
- the standard shell, while imposing a limited menu of commands; this
- scheme assumes that the end-user does not have write and execute
- permissions in the same directory.
-
- The net effect of these rules is that the writer of the ._p_r_o_f_i_l_e (see
- _p_r_o_f_i_l_e(4)) has complete control over user actions by performing
- guaranteed setup actions and leaving the user in an appropriate directory
-
-
-
- PPPPaaaaggggeeee 11117777
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- (probably _n_o_t the login directory).
-
- The system administrator often sets up a directory of commands (that is,
- /_u_s_r/_r_b_i_n) that can be safely invoked by a restricted shell. IRIX
- provides a restricted editor, _r_e_d(1).
-
- EEEEXXXXIIIITTTT SSSSTTTTAAAATTTTUUUUSSSS
- Errors detected by the shell, such as syntax errors, cause the shell to
- return a nonzero exit status. If the shell is being used
- noninteractively execution of the shell file is abandoned. Otherwise,
- the shell returns the exit status of the last command executed (see also
- the eeeexxxxiiiitttt command above).
-
- jjjjsssshhhh OOOOnnnnllllyyyy
- If the shell is invoked as _jjjj_ssss_hhhh and an attempt is made to exit the shell
- while there are stopped jobs, the shell issues one warning:
-
- _UUUU_XXXX_::::_jjjj_ssss_hhhh_::::_WWWW_AAAA_RRRR_NNNN_IIII_NNNN_GGGG_::::_tttt_hhhh_eeee_rrrr_eeee _aaaa_rrrr_eeee _ssss_tttt_oooo_pppp_pppp_eeee_dddd _jjjj_oooo_bbbb_ssss
-
- This is the only message. If another exit attempt is made and there are
- still stopped jobs, they are sent a _SSSS_IIII_GGGG_HHHH_UUUU_PPPP signal from the kernel and the
- shell is exited.
-
- FFFFIIIILLLLEEEESSSS
- /etc/profile
- $HOME/....profile
- /tmp/sh*
- /dev/null
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- cd(1), echo(1), env(1), getopts(1), intro(1), login(1), newgrp(1),
- pwd(1), systune(1m), test(1), umask(1), wait(1), xargs(1), dup(2),
- exec(2), fork(2), getrlimit(2), pipe(2), signal(2), ulimit(2),
- profile(4).
-
- CCCCAAAAVVVVEEEEAAAATTTTSSSS
- Positional parameters have a range of 0 to 9. Attempting to use the
- positional parameter $$$$11110000 gives the contents of $$$$1111 followed by a 0000, which
- is probably not the desired result.
-
- Words used for filenames in input/output redirection are not interpreted
- for filename generation (see FFFFiiiilllleeeennnnaaaammmmeeee GGGGeeeennnneeeerrrraaaattttiiiioooonnnn, above). For example,
- ccccaaaatttt ffffiiiilllleeee1111 >>>>aaaa**** creates a file with the name aaaa****.
-
- Because commands in pipelines are run as separate processes, variables
- set in a pipeline have no effect on the parent shell.
-
- If you get the error message "cannot fork, too many processes", try using
- the _w_a_i_t(1) command to clean up your background processes. If this
- doesn't help, the system process table is probably full or you have too
- many active foreground processes. (There is a limit to the number of
- process ids associated with your login, and to the number the system can
-
-
-
- PPPPaaaaggggeeee 11118888
-
-
-
-
-
-
- bbbbsssshhhh((((1111)))) bbbbsssshhhh((((1111))))
-
-
-
- keep track of.)
-
- For compatibility with the POSIX builtin executables linked to
- /sbin/builtin_exec, the Korn shell parameter expansion
- ${parameter##pattern} has been implemented only for the specific pattern
- '*/' to emulate basename. This allows the Bourne shell builtins to work
- correctly when called with fullpaths e.g. /sbin/jobs.
-
- NNNNOOOOTTTTEEEESSSS
- Sometimes, particularly when using wildcards, the shell will fail to
- execute a command, and complain with the message
- AAAArrrrgggg lllliiiisssstttt oooorrrr eeeennnnvvvviiiirrrroooonnnnmmmmeeeennnntttt ttttoooooooo llllaaaarrrrggggeeee
- This can often be avoided by using multiple commands, the _x_a_r_g_s(1)
- command, or by increasing the nnnnccccaaaarrrrggggssss kernel parameter with the
- _s_y_s_t_u_n_e(1m) command.
-
- BBBBUUUUGGGGSSSS
- Only the last process in a pipeline can be waited for.
-
- If a command is executed, and a command with the same name is installed
- in a directory in the search path before the directory where the original
- command was found, the shell continues to _e_x_e_c the original command. Use
- the hhhhaaaasssshhhh command to correct this situation.
-
- Prior to IRIX Release 5.0, the _rrrr_ssss_hhhh command invoked the restricted shell.
- This restricted shell command is _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_rrrr_ssss_hhhh and it can be executed by
- using the full pathname. Beginning with IRIX Release 5.0, the _rrrr_ssss_hhhh
- command is the remote shell. See _rrrr_ssss_hhhh______bbbb_ssss_dddd(1C).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 11119999
-
-
-
-